package com.zy.openchat.core.model.remittance;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.SerializedName;

public class RemittanceDetailInfo implements Parcelable {

    //    RemittanceStatusInitial          = 0 //未收款
//    RemittanceStatusReceived         = 1 //已收款
//    RemittanceStatusRefundedByUser   = 2 //用户退款
//    RemittanceStatusRefundedBySystem = 3 //系统退款（超过一天未收款）
    public int status;
    @SerializedName(value = "chatId",alternate = {"ChatID"})
    public long chatId;
    @SerializedName(value = "remittanceId",alternate = {"ID"})
    public long remittanceId;
    @SerializedName(value = "payerUID",alternate = {"PayerUID"})
    public long payerUID;
    @SerializedName(value = "payeeUID",alternate = {"PayeeUID"})
    public long payeeUID;
    //创建时间
    @SerializedName(value = "remittedAt",alternate = {"RemittedAt"})
    public long remittedAt;
    //收款时间
    @SerializedName(value = "receivedAt",alternate = {"ReceivedAt"})
    public long receivedAt;
    //退款时间
    @SerializedName(value = "refundedAt",alternate = {"RefundedAt"})
    public long refundedAt;
    @SerializedName(value = "description",alternate = {"Description"})
    public String description;
    @SerializedName(value = "amount",alternate = {"Amount"})
    public float amount;


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.status);
        dest.writeLong(this.chatId);
        dest.writeLong(this.remittanceId);
        dest.writeLong(this.payerUID);
        dest.writeLong(this.payeeUID);
        dest.writeLong(this.remittedAt);
        dest.writeLong(this.receivedAt);
        dest.writeLong(this.refundedAt);
        dest.writeString(this.description);
        dest.writeFloat(this.amount);
    }

    public void readFromParcel(Parcel source) {
        this.status = source.readInt();
        this.chatId = source.readLong();
        this.remittanceId = source.readLong();
        this.payerUID = source.readLong();
        this.payeeUID = source.readLong();
        this.remittedAt = source.readLong();
        this.receivedAt = source.readLong();
        this.refundedAt = source.readLong();
        this.description = source.readString();
        this.amount = source.readFloat();
    }

    public RemittanceDetailInfo() {
    }

    protected RemittanceDetailInfo(Parcel in) {
        this.status = in.readInt();
        this.chatId = in.readLong();
        this.remittanceId = in.readLong();
        this.payerUID = in.readLong();
        this.payeeUID = in.readLong();
        this.remittedAt = in.readLong();
        this.receivedAt = in.readLong();
        this.refundedAt = in.readLong();
        this.description = in.readString();
        this.amount = in.readFloat();
    }

    public static final Creator<RemittanceDetailInfo> CREATOR = new Creator<RemittanceDetailInfo>() {
        @Override
        public RemittanceDetailInfo createFromParcel(Parcel source) {
            return new RemittanceDetailInfo(source);
        }

        @Override
        public RemittanceDetailInfo[] newArray(int size) {
            return new RemittanceDetailInfo[size];
        }
    };
}
